import Ember from 'ember';
import config from 'game-front/config/environment';

export default Ember.Component.extend({
	classNames:["mysite-bgimg", " mysite-margin"],
	actions: {
      home (address) {
        const $ = Ember.$;
        $(".shade").css({"display":"block"});
        $(".div-shade").css({"display":"block"});
        $(".div-shade").find("#confirm").on("click", function () {
          $.ajax({
            method: "DELETE",
            url: config.apiBase + "addresses/" + address.id + "?userId=" + address.userId,
            contentType:"application/json",
            dataType:"json"
          }) .done(function(resp) {
            if (resp.success) {
              window.location.href = config.baseURL + "mysite";
            }

          });
        });
      }
	}
});
